Skip to content

Improve markdown file link UX#1956

Open
justsomelegs wants to merge 3 commits intopingdotgg:mainfrom
justsomelegs:feat/markdown-file-link-chips
Open

Improve markdown file link UX#1956
justsomelegs wants to merge 3 commits intopingdotgg:mainfrom
justsomelegs:feat/markdown-file-link-chips

Conversation

@justsomelegs
Copy link
Copy Markdown
Contributor

@justsomelegs justsomelegs commented Apr 12, 2026

What Changed

This tightens the UX for markdown-rendered local file links and keeps file-path presentation more consistent across assistant surfaces.

  • Render local markdown file links as dedicated inline file chips instead of plain links
  • Add file icons, hover tooltip paths, right-click actions, and line/column labels when present
  • Disambiguate duplicate basenames inline within the same markdown message
  • Format displayed file paths from the workspace/repo root instead of absolute machine paths where possible
  • Reuse that repo-relative formatting in timeline changed-file previews/badges
  • Split markdown chip styling away from composer chips and restyle it to match markdown inline code more closely
  • Memoize markdown file chips so identical links do less work during streaming
  • Stabilize the touched timeline test under full-suite load

Why

Assistant messages were hard to scan when they referenced the same filename multiple times, especially when the visible markdown text was just menu.tsx or MessagesTimeline.tsx repeatedly. The useful context existed in the href, but the UI was not surfacing it well.

This approach keeps the change small and local to existing rendering paths:

  • improves readability without changing message semantics
  • keeps normal web links untouched
  • preserves editor-open behavior
  • avoids duplicating path-formatting logic by extracting a shared formatter
  • makes markdown file refs feel like part of prose rather than composer UI

UI Changes

Before:

  • local file refs looked like normal links
  • repeated basenames were hard to distinguish
  • tooltips showed machine-absolute paths
  • markdown file refs visually felt disconnected from nearby inline code

After:

  • local file refs render as inline file chips
  • duplicate basenames gain inline suffix disambiguation when needed
  • tooltips show workspace-relative paths
  • chip styling now sits closer to markdown inline code

Screenshots:
CHIPS
Screenshot 2026-04-12 133217
CONTEXT MENU
Screenshot 2026-04-12 131112
HOVER TOOLTIP
Screenshot 2026-04-12 130612

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Render markdown file links as styled chips with tooltips, line/column labels, and editor actions

  • File links in chat markdown are now rendered as chip-like elements with a VS Code icon, a truncated label, and a tooltip showing the relative and full path, replacing plain anchor tags.
  • Links support a context menu to open in the preferred editor, copy relative path, or copy full path; failed opens show an error toast.
  • Accessible labels include line/column info (e.g., · L1 or · L1:C7), and duplicate basenames are disambiguated by showing parent path segments.
  • Introduces formatWorkspaceRelativePath in filePathDisplay.ts and resolveMarkdownFileLinkMeta in markdown-links.ts to compute workspace-relative display paths with parsed line/column.
  • Work entry file path chips in MessagesTimeline.tsx now display workspace-relative paths instead of raw absolute paths.

Macroscope summarized 4fac05f.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dd186e67-dcfc-4327-ae89-3dba713c6426

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 12, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 12, 2026

Approvability

Verdict: Needs human review

This PR adds substantial new UI capability for markdown file links including a new component with tooltips, context menus, path disambiguation, and ~650 lines of new code. While technically safe (pure display logic with tests), it introduces meaningful new user-facing behavior that warrants human review before merging.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant